/*
 * Copyright (c) 2021 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef SWANLINK_FINANCE_MAKECARD_SERVICES_NATIVE_INCLUDE_MAKECARD_SERVICE_H
#define SWANLINK_FINANCE_MAKECARD_SERVICES_NATIVE_INCLUDE_MAKECARD_SERVICE_H

#include "system_ability.h"
#include "iremote_object.h"
#include "imakecard_srv.h"
#include "makecard_srv_stub.h"
#include "sp_singleton.h"
#include "cashdevice_service.h"
#include "imakecard_adaptor.h"
namespace SwanLink {
namespace Finance {

class MakecardService final : public SystemAbility,
    public MakecardSrvStub {
DECLARE_SYSTEM_ABILITY(MakecardService)

DECLARE_DELAYED_SP_SINGLETON(MakecardService);
 public:
    void OnDump() override;
    void OnStart() override;
    void OnStop() override;

    int32_t Dump(int fd, const std::vector<std::u16string> &args) override;

    /**
     * 设置打印机配置
     */
    int SetConfig(int handle, int configType, int configValue) override;
    /**
     * 设置standby参数
     */
    int SetStandbyParam(int handle, int dir, int pos, int standbyTime) override;
    /**
     * 打印卡片
     */
    int PrintCard(int handle, BmpInfo cardBmpInfo) override;
    /**
     * 获取打印机信息
     */
    int GetDeviceInfo(int handle, int infoType, char *infoValue) override;
    /**
     * 获取错误信息
     */
    int GetErrorString(int handle, int status, char* statusDesc) override;
    /**
     * 传动卡片到指定位置
     */
    int MoveCard(int handle, int postionMoveTo) override;
    /**
     * 翻转卡片
     */
    int FlipCard(int handle) override;

 private:
    bool Init();
    bool ready;
    bool isBusy;
};
}  // namespace Finance
}  // namespace SwanLink

#endif  // SWANLINK_FINANCE_MAKECARD_SERVICES_NATIVE_INCLUDE_MAKECARD_SERVICE_H
